#include<stdio.h>
#include<stdlib.h>
#include <cmath> 
#include <time.h>

double power(double a, int n) 
{
	double b;
	if (n == 0) return 1;
	if (n&1 == 1)
		{
			return power(a, n-1) * a;
		}
	else 
		{
			b = power(a, n>>1);
			return b * b;
		}
}
void main()
{
	double a;
	int n, check;
	printf("Enter BASE and POWER:\n");
	check=scanf("%lf %d", &a, &n);
	if(check!=2)
		{
			printf("Wrong input!\n");
			return;
		}
	printf("%lf\n", power(a, n));
	system("PAUSE");
}